﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Data;

namespace metroCIS.Win8Application.Converters
{
    public class GradeToSmileyConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value == null)
                return null;
            switch (value.ToString().ToLower())
            {
                case "sehr gut":
                    return new Uri("ms-appx:/Images/1.png");
                case "gut":
                    return new Uri("ms-appx:/Images/2.png");
                case "befriedigend":
                    return new Uri("ms-appx:/Images/3.png");
                case "genügend":
                    return new Uri("ms-appx:/Images/4.png");
                case "nicht genügend":
                    return new Uri("ms-appx:/Images/5.png");
            }
            return new Uri("ms-appx:/Images/6.png");
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
